/* Camera Example

    This example code is in the Public Domain (or CC0 licensed, at your option.)
    Unless required by applicable law or agreed to in writing, this
    software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
    CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include "esp_wifi.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "esp_event.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "button.h"
#include "page.h"
#include "esp_event.h"
#include "driver/rmt.h"
#include "lvgl.h"
#include "ui.h"
// #include "esp_camera.h"
#include "mywifi.h"

#include "board.h"
#include "httpapi.h"
#include "mp3.h"
#include "net_process.h"

static const char *TAG = "main";

esp_periph_set_handle_t set;
void app_main()
{
    /*< RGB display */
    esp_err_t ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
    {
        ESP_ERROR_CHECK(nvs_flash_erase());
        ret = nvs_flash_init();
    }
    ESP_ERROR_CHECK(ret);

    // wifiScanQueue = xQueueCreate(1, sizeof(int));

    ESP_ERROR_CHECK(esp_netif_init());



    esp_periph_config_t periph_cfg = DEFAULT_ESP_PERIPH_SET_CONFIG();
    set = esp_periph_set_init(&periph_cfg);
    page_init();
    mp3_init(set);
    net_process_init(set);
    ui_init();
    my_wifi_init();

}
